package com.itheima.array;

import com.itheima.domain.Student;

import java.util.ArrayList;

public class ArrayListDemo04 {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        Student stu1 = new Student("heima001","张三",20,80.5);
        Student stu2 = new Student("heima002","李四",18,85);
        Student stu3 = new Student("heima003","王五",22,91);
        list.add(stu1);
        list.add(stu2);
        list.add(stu3);
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i).getName() + "  " + list.get(i).getAge());
        }
    }
}
